package com.design03_behavioral.pattern16_responsibilityChains.example03;

import com.design03_behavioral.pattern16_responsibilityChains.example02.AuthInfo;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Logger;

/**
 * @ClassName AuthLink
 * @Description TODO
 * @Author zhangjunhao
 * @DATE 2023/9/9 0:52
 */
public abstract class AuthLink {

    protected Logger logger = Logger.getLogger("AuthLink");

    protected SimpleDateFormat f =new SimpleDateFormat("yyyy-MM-dd HH:MM:ss");

    protected String levelUserId; //审核人ID
    protected String levelUserName; //审核人姓名
    protected AuthLink next; //持有下一个处理类的引用

    public AuthLink(String levelUserId, String levelUserName)
    {
        this.levelUserId = levelUserId;
        this.levelUserName = levelUserName;
    }

    //获取下一个处理类
    public AuthLink getNext() {
        return next;
    }

    //责任链中添加处理类
    public AuthLink appendNext(AuthLink next) {
        this.next = next;
        return this;
    }

    //抽象审核方法
    public abstract AuthInfo doAuth(String uId, String orderId, Date authDate);

}
